# 参数传递的可变与不可变

# 不可变(不可变参数类型)
def test1(a):
    a = 1
    print(a)


a = 2
test1(a)
print(a)


# 不可变(可变参数类型)
def test2(a_list):
    a = [1, 2, 3]
    print(a)


glo_list = [4, 5, 6]
test2(glo_list)
print(glo_list)


# 可变(可变参数类型) 在使用方法对可变参数进行操作时
def test3(a_list):
    a_list.append(4)
    print(a_list)


glo_list2 = [1, 2, 3]
test3(glo_list2)
print(glo_list2)
